package string;
/** String substring(int start,int and) 截取 */
public class SubstringDemo {
    public static void main(String[] args) {
        //            012345678901234567890123456789
        String str = "www.tedu.cn";
        int start = str.indexOf(".")+1;//4
        int end = str.indexOf(".",start);//8
        String name = str.substring(start,end);//截取下标字符串
        System.out.println(name);//tedu
    }
}
